{% macro pagination(page, pages) %}
<nav class="pagination is-centered" role="navigation" aria-label="pagination">
    <!-- <a href="{%if page==1 %}javascript:void(0);{%else%}{{page-1}}{%endif%}"
        class="pagination-previous {%if page==1 %}is-disabled{%endif%}">上一页</a>
    <a href="{%if page==pages %}javascript:void(0);{%else%}{{page+1}}{%endif%}"
        class="pagination-next {%if page==pages %}is-disabled{%endif%}">下一页</a> -->
    <ul class="pagination-list">
        {%for i in iter_page(page = page, pages = pages)%}
        {%if i%}
        <li><a href="{{url_for(url=" /cms/category",page=i)}}"
                class="pagination-link {%if page==i %}is-current{%endif%}">{{i}}</a></li>
        {%else%}
        <li><span class="pagination-ellipsis">&hellip;</span></li>
        {% endif%}
        {%endfor%}
    </ul>
</nav>
{% endmacro pagination %}

{% macro article_item(article) %}
<section class="section1 py-3 mx-3 columns" style="border-bottom: 1px solid #dadee5;">
    <div class="column">
        <header>
            <a href="/cms/article/{{article.id}}">
                <h1 class="title has-text-grey-dark">{{article.title}}</h1>
            </a>
            <p>
                <time datetime="">{{article.publish_at|date(format="%Y-%m-%d")}}</time>
                <span>预览 {{article.read_number}}</span>
                <span class="tag"> Tag label </span>
                <span class="tag"> Tag label </span>
            </p>
        </header>
        <h2 class="subtitle has-text-grey">
            {{article.description}}
        </h2>
    </div>
    {% if article.image %}
    <div
        style="width: 150px;height: 80px;background-image: url({{article.image}});background-size: contain;background-repeat: no-repeat;">
    </div>
    {% endif %}
</section>
{% endmacro pagination %}